home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-MIPS / NAMEI.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  1KB  |  56 lines

  1. /*
  2.  * linux/include/asm-mips/namei.h
  3.  *
  4.  * Included from linux/fs/namei.c
  5.  *
  6.  * $Id: namei.h,v 1.10 1998/10/28 08:13:24 jj Exp $
  7.  */
  8. #ifndef __ASM_MIPS_NAMEI_H
  9. #define __ASM_MIPS_NAMEI_H
  10.  
  11. #include <linux/config.h>
  12.  
  13. /* Only one at this time. */
  14. #define IRIX32_EMUL "usr/gnemul/irix/"
  15.  
  16. static inline struct dentry *
  17. __mips_lookup_dentry(const char *name, int lookup_flags)
  18. {
  19.     struct dentry *base;
  20.  
  21.     if (current->personality != PER_IRIX32)
  22.         return ERR_PTR(-ENOENT);
  23.  
  24.     base = lookup_dentry (IRIX32_EMUL,
  25.             dget (current->fs->root), 
  26.             (LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_SLASHOK));
  27.             
  28.     if (IS_ERR (base)) return base;
  29.     
  30.     base = lookup_dentry (name, base, lookup_flags);
  31.  
  32.     if (IS_ERR (base)) return base;
  33.  
  34.     if (!base->d_inode) {
  35.         dput(base);
  36.         return ERR_PTR(-ENOENT);
  37.     }
  38.         
  39.         return base;
  40. }
  41.  
  42. #ifdef CONFIG_BINFMT_IRIX
  43.  
  44. #define __prefix_lookup_dentry(name, lookup_flags)                \
  45.     dentry = __mips_lookup_dentry (name, lookup_flags);            \
  46.     if (!IS_ERR (dentry)) return dentry;
  47.  
  48. #else /* !defined(CONFIG_BINFMT_IRIX) */
  49.  
  50. #define __prefix_lookup_dentry(name, lookup_flags) \
  51.         do {} while (0)
  52.  
  53. #endif /* !defined(CONFIG_BINFMT_IRIX) */
  54.  
  55. #endif /* __ASM_MIPS_NAMEI_H */
  56.